#!/bin/bash
QT_JAMBI_VERSION=4.3.3_01
export QTJAMBI_VERSION

GROUP_ID=ech.trolltech
QT_JAMBI_LINUX_NATIVE_32_ARTIFACT_ID=qtjambi-native-linux-32
QT_JAMBI_WIN_NATIVE_32_ARTIFACT_ID=qtjambi-native-win-32
QT_JAMBI_MAC_NATIVE_32_ARTIFACT_ID=qtjambi-native-mac-32
QT_JAMBI_ARTIFACT_ID=qtjambi

QT_JAMBI_WIN_32_DIR=qtjambi-win32-gpl-$QT_JAMBI_VERSION
QT_JAMBI_WIN_32_FILE=$QT_JAMBI_WIN_32_DIR.zip
QT_JAMBI_WIN_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_WIN_32_FILE
export QT_JAMBI_WIN_32_URL

QT_JAMBI_LINUX_32_DIR=qtjambi-linux32-gpl-$QT_JAMBI_VERSION
QT_JAMBI_LINUX_32_FILE=$QT_JAMBI_LINUX_32_DIR.tar.gz
QT_JAMBI_LINUX_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_LINUX_32_FILE
export QT_JAMBI_LINUX_32_URL

QT_JAMBI_MAC_32_DIR=qtjambi-mac-gpl-$QT_JAMBI_VERSION
QT_JAMBI_MAC_32_FILE=$QT_JAMBI_MAC_32_DIR.tar.gz
QT_JAMBI_MAC_32_URL=ftp://ftp.trolltech.com/qtjambi/source/$QT_JAMBI_MAC_32_FILE
export QT_JAMBI_LINUX_32_URL

# Create pom files for linux native
cat >pom.xml <<Endofmessage
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>$GROUP_ID</groupId>
	<artifactId>$QT_JAMBI_LINUX_NATIVE_32_ARTIFACT_ID</artifactId>
	<packaging>pom</packaging>
	<version>$QT_JAMBI_VERSION</version>
	<name>QT Jambi deployement pom</name>
	
	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav</artifactId>
				<version>1.0-beta-2</version>
			</extension>
		</extensions>
	</build>
	
</project>
Endofmessage

# Install qtjambi-native  jar into repository
mvn deploy:deploy-file  \
                        -DrepositoryId=central-mirror \
                        -Durl=dav:http://builder:8080/archiva/repository/releases/  \
                        -DgroupId=$GROUP_ID \
                        -DartifactId=$QT_JAMBI_LINUX_NATIVE_32_ARTIFACT_ID \
                        -Dversion=$QT_JAMBI_VERSION \
                        -Dpackaging=jar \
			-Dfile=qtjambi-native-32-linux.jar

cat >pom.xml <<Endofmessage
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>$GROUP_ID</groupId>
	<artifactId>$QT_JAMBI_WIN_NATIVE_32_ARTIFACT_ID</artifactId>
	<packaging>pom</packaging>
	<version>$QT_JAMBI_VERSION</version>
	<name>QT Jambi deployement pom</name>
	
	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav</artifactId>
				<version>1.0-beta-2</version>
			</extension>
		</extensions>
	</build>
	
</project>
Endofmessage

mvn deploy:deploy-file  \
                        -DrepositoryId=central-mirror \
                        -Durl=dav:http://builder:8080/archiva/repository/releases/  \
                        -DgroupId=$GROUP_ID \
                        -DartifactId=$QT_JAMBI_WIN_NATIVE_32_ARTIFACT_ID \
                        -Dversion=$QT_JAMBI_VERSION \
                        -Dpackaging=jar \
			-Dfile=qtjambi-native-32-win.jar


cat >pom.xml <<Endofmessage
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>$GROUP_ID</groupId>
	<artifactId>$QT_JAMBI_MAC_NATIVE_32_ARTIFACT_ID</artifactId>
	<packaging>pom</packaging>
	<version>$QT_JAMBI_VERSION</version>
	<name>QT Jambi deployement pom</name>
	
	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav</artifactId>
				<version>1.0-beta-2</version>
			</extension>
		</extensions>
	</build>
	
</project>
Endofmessage

mvn deploy:deploy-file  \
                        -DrepositoryId=central-mirror \
                        -Durl=dav:http://builder:8080/archiva/repository/releases/  \
                        -DgroupId=$GROUP_ID \
                        -DartifactId=$QT_JAMBI_MAC_NATIVE_32_ARTIFACT_ID \
                        -Dversion=$QT_JAMBI_VERSION \
                        -Dpackaging=jar \
			-Dfile=qtjambi-native-32-mac.jar



cat >pom.xml <<Endofmessage
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>$GROUP_ID</groupId>
	<artifactId>$QT_JAMBI_ARTIFACT_ID</artifactId>
	<packaging>pom</packaging>
	<version>$QT_JAMBI_VERSION</version>
	<name>QT Jambi deployement pom</name>
	
	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav</artifactId>
				<version>1.0-beta-2</version>
			</extension>
		</extensions>
	</build>
	
</project>
Endofmessage

mvn deploy:deploy-file  \
                        -DrepositoryId=central-mirror \
                        -Durl=dav:http://builder:8080/archiva/repository/releases/  \
                        -DgroupId=$GROUP_ID \
                        -DartifactId=$QT_JAMBI_ARTIFACT_ID \
                        -Dversion=$QT_JAMBI_VERSION \
                        -Dpackaging=jar \
			-Dfile=$QT_JAMBI_LINUX_32_DIR/qtjambi.jar
